using System;
using System.IO;
using System.Text;
using System.Windows.Forms;

namespace downloadfilestool
{
	public static class LogHelper
	{
		public static void WriteLog(string content)
		{
			string expr_26 = string.Format("{0}/logs/{2}_{1}.txt", Application.StartupPath, DateTime.Now.ToString("yyyyMMdd"), "log");
			FileInfo fileInfo = new FileInfo(expr_26);
			if (!fileInfo.Directory.Exists)
			{
				fileInfo.Directory.Create();
			}
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("================系统错误日志==================");
			stringBuilder.AppendLine(content);
			stringBuilder.AppendFormat("================{0}===================", DateTime.Now);
			stringBuilder.AppendLine();
			File.AppendAllText(expr_26, stringBuilder.ToString());
		}
	}
}
